package JLB_Chapter_11;

public class code_11_05 {
    enum Constants2 {
        Constants_A("我是枚举成员A"),
        Constants_B("我是枚举成员B"),
        Constants_C("我是枚举成员C"),
        Constants_D(3);
        private String description;
        private int i = 4;
        private Constants2(String description) {
            this.description = description;
        }
        private Constants2(int i) {
            this.i = this. i + i;
        }
        public String getDescription() {
            return description;
        }
        public int getI() {
            return i;
        }
    }
    public static void main(String[] args) {
        Constants2[] array = Constants2.values();
        for(int i = 0; i < array.length; i++) {
            System.out.println(array[i] + ":" + array[i].getDescription());
        }
        Constants2 c2 = Constants2.valueOf("Constants_D");
        System.out.println(c2 + ":" + c2.getI());
    }
}
